Skip to content

fix(opencode-claimant): count claimant roots only toward the session cap (#5016) - #10733

Merged
dezren39 merged 1 commit into
mainfrom
queue/17428-5016-claimant-cap
Nov 17, 2026
Merged

dezren39 merged 1 commit into
mainfrom
queue/17428-5016-claimant-cap

Conversation

@dezren39

@dezren39 dezren39 commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

Fixes #5016. Implements ruling session-cap-5016 (recorded 2026-11-16T02:00:33-06:00 via orchestrator-audit-2026-11-16; agent note 6911818474 on #5016).

What changes

The claimant concurrency cap is the claimant's launch budget: only claimant work roots consume slots. Scheduled fleet sessions — lane runners (Queue lane (scheduled) - ...), the claimant's own fire (Opencode lane claimant/executor - ...), sweeps and the conductor — are infrastructure outside the cap. They all carry metadata.openchamber.kind == "scheduled" on the OpenCode session (verified live 2026-11-16 across 366 roots); title prefixes are the fallback for legacy rows.

A server-active root whose time.updated has not moved for ACTIVE_SET_STALE_MS (2 h) is a zombie — #5016's ~18 h session — and releases its slot. Releasing a slot only changes cap accounting; it never kills a session.

  • pm-stack/opencode-claimant/poll.py: is_scheduled_session, is_claimant_root_session, count_active_claimant_roots; staleness bound applied to active-set members in _active_root_state; summarize_cap / get_active_root_session_count count claimant roots.
  • pm-stack/opencode-claimant/claimant.py: cap_step's counter delegates to the claimant count (same poll.py function).
  • pm-stack/opencode-claimant/test_poll.py: TestClaimantCapAccounting — oracle is the opencode-claimant: the 12-session cap is consumed by lane runners, the claimant itself and an 18h zombie session — so 44 eligible candidates never launch #5016 census table (11 lane runners + claimant fire + 1 running work session + 18 h zombie → claimant count 1, not 14), an invariant sweep that 0..40 lane runners never change headroom, and the 2 h staleness boundary.
  • prompt.md / README.md: cap semantics stated as claimant roots only.

Cap value unchanged (36; raised 12 → 20 → 36 on 2026-11-05). No scheduler/cadence changes.

Verification

cd pm-stack/opencode-claimant && python3 -I run_hermetic_tests.py → Ran 124 tests ... OK

Live read-only check against the laptop server 2026-11-16: 22 active roots of which only 4 are claimant roots; old accounting cap_room 14, new cap_room 32.

Sibling task 17446 (#3418, budget-aware claiming) is untouched.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…cap (#5016)

Ruling session-cap-5016: the concurrency cap is the claimant's launch
budget. Scheduled fleet sessions (lane runners, the claimant's own
fire, sweeps, the conductor) are infrastructure outside it; only
claimant work roots consume slots. A server-active root whose clock has
not moved for ACTIVE_SET_STALE_MS (2 h) is a zombie (#5016's ~18 h
session) and releases its slot.

- poll.py: is_scheduled_session / is_claimant_root_session,
  count_active_claimant_roots, staleness bound on active-set members;
  summarize_cap and get_active_root_session_count count claimant roots.
- claimant.py: cap_step's counter delegates to the claimant count.
- test_poll.py: TestClaimantCapAccounting (census-mix oracle from
  #5016, scheduled-population invariant sweep, staleness boundary).
- prompt.md/README.md: the cap's meaning stated as claimant roots only.

Cap value unchanged (36; raised from 12 to 20 to 36 on 2026-11-05).
@dezren39
dezren39 requested a review from a team as a code owner November 16, 2026 12:22
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-16T12:22:28.691411Z
We couldn’t complete this review. Comment @codex review to try again.
689f4b6 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 20 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e954ade5-3931-40e9-8c16-a3a27ff4bb5f
Commits

Reviewing files that changed from the base of the PR and between 71e67a6 and 689f4b6.

Files selected for processing: 5

  • pm-stack/opencode-claimant/README.md
  • pm-stack/opencode-claimant/claimant.py
  • pm-stack/opencode-claimant/poll.py
  • pm-stack/opencode-claimant/prompt.md
  • pm-stack/opencode-claimant/test_poll.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@dezren39
dezren39 merged commit 16e0c26 into main Nov 17, 2026
1 check passed
@dezren39
dezren39 deleted the queue/17428-5016-claimant-cap branch November 17, 2026 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant